<?php
/* @var $this PartnerSettingController */
/* @var $model PartnerSetting */

$this->breadcrumbs=array(
	yii::t('base','Partner Setting')=>array('index'),
	yii::t('base','Manage'),
);

$this->menu=array(
	array('label'=>'List PartnerSetting', 'url'=>array('index')),
	array('label'=>'Create PartnerSetting', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#partner-setting-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1><?php echo Yii::t('base','Manage Partner Settings') ?></h1>

<?php echo CHtml::link(Yii::t('base','Advanced Search'),'#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->
<a class="btn btn-small create" title="设置提成" href="<?php echo Yii::app()->request->baseUrl; ?>/partnerSetting/create">设置提成</a>
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'partner-setting-grid',
	'dataProvider'=>$model->search(),
    'itemsCssClass'=>'responsive table table-striped table-bordered',
	'pager'=>array('class'=>'CLinkPager','hiddenPageCssClass'=>'','firstPageCssClass'=>'first paginate_button','htmlOptions'=>array('class'=>'dataTables_paginate paging_full_numbers"'),'header'=>""),
	'pagerCssClass'=>'pagination',
	'cssFile'=>false,
	'template'=>'{items}{summary}{pager}',
	'columns'=>array(
        array('name'=>'partner_type','value'=>'PartnerSetting::model()->PartnerType($data->partner_type)'),
		//'partner_setting_id',
		'min',
		'max',
		'push_money',
        array('name'=>'is_delete','value'=>'PartnerSetting::model()->is_delete($data->is_delete)'),
		/*
		'create_time',
		'update_time',
		*/
		array(
			'class'=>'CButtonColumn',
			'header'=>Yii::t('base','Operate'),
			'updateButtonImageUrl'=>array('class'=>'gicon-edit'),
			'updateButtonOptions'=>array('class'=>'btn btn-small'),
			'deleteButtonImageUrl'=>array('class'=>'gicon-edit'),
			'deleteButtonOptions'=>array('class'=>'btn btn-inverse btn-small'),
			'template'=>'{update}{delete}',
			'buttons'=>array(
				'update'=>array(
					//'visible'=>'$data->is_delete==0',
				),
			),
		),
	),
)); ?>
